package com.ddxz.elastic.config;

import com.dangdang.ddframe.job.executor.ShardingContexts;
import com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;

/**
 * description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2021/2/23
 */

@Configuration
public class DdxzElasticListener implements ElasticJobListener {
    @Override
    public void beforeJobExecuted(ShardingContexts shardingContexts) {
        LOGGER.info("{} starting at {}", shardingContexts.toString(), System.currentTimeMillis());
    }

    @Override
    public void afterJobExecuted(ShardingContexts shardingContexts) {
        LOGGER.info("{} finished at {}", shardingContexts.toString(), System.currentTimeMillis());
    }

    private static final Logger LOGGER = LoggerFactory.getLogger(DdxzElasticListener.class);
}
